﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PrintLabel
{
    public static class ResultGenerator
    {
        private static string DEFAULT_SUCCESS_MESSAGE = "SUCCESS";
        private static int SUCCESS = 200;
        private static int FAIL = 400;

        public static Result success()
        {
            Result result = new Result();
            result.code = SUCCESS;
            result.message = DEFAULT_SUCCESS_MESSAGE;
            return result;
        }

        public static Result success(object data)
        {
            Result result = new Result();
            result.code = SUCCESS;
            result.message = DEFAULT_SUCCESS_MESSAGE;
            result.data = data;
            return result;
        }

        public static Result fail(string message)
        {
            Result result = new Result();
            result.code = FAIL;
            result.message = message;
            return result;
        }
    }
}
